package org.coderead.calculator;

import org.coderead.model.Performance;

public class TragedyCalculator extends AbstractPerformanceCalculator {

    @Override
    public int getAmount(Performance performance) {
        if (performance.getAudience() <= 30) {
            return 40000;
        }
        return 40000 + 1000 * (performance.getAudience() - 30);
    }

    @Override
    public double getVolumeCredit(Performance performance) {
        return Math.max(performance.getAudience() - 30, 0);
    }
}